package br.com.azservicos.dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class DAOFactory {

   private static final EntityManagerFactory factory = Persistence.createEntityManagerFactory("com.mycompany_AZServicos_war_1.0-SNAPSHOTPU");
  
   public static EntityManagerFactory getFactory(){
       return factory;
   }
   
   public static EntityManager criarEntityManager(){
       return factory.createEntityManager();
   }
   
   public static GenericDAO criarGenericDAO(Class<?> clazz){
       return new GenericDAOImpl(clazz);
   }
   
    public static void main(String[] args) {
        factory.close();
    }
   
   
   
}
